
#ifndef __GM_SIM_PHYS_H__
#define __GM_SIM_PHYS_H__

#include "SimUtils.hh"
#include "chipmunk/chipmunk.h"

class GMSimPhys {

private:
	cpVect FIELD_BL;
        cpVect FIELD_BR;
        cpVect FIELD_UR;
        cpVect FIELD_UL;
        cpVect WORLD_BL;
        cpVect WORLD_BR;
        cpVect WORLD_UR;
        cpVect WORLD_UL;
        cpVect GOALOUR_B;
        cpVect GOALOUR_U;
        cpVect GOALOPP_B;
        cpVect GOALOPP_U;
        cpSpace *space;
        cpBody *robot[NUM_ROB];
        cpBody *ball;
	int kick[NUM_ROB];
        int dribble[NUM_ROB];
        int placar_a, placar_b;
        float rob_vx[NUM_ROB], rob_vy[NUM_ROB];
	
	float dist(cpVect, cpVect);

public:
	GMSimPhys( void );
	void update( void );
	void get_ballpos( float * ballpos );
	void set_ballpos( float * ballpos );
	void set_ballvel( float * ballvel );
	void get_robotpos( float * robotpos, int i );
	void get_robotang( float * robotang, int i );
	void set_robotpos( float * robotpos, int i );
	void set_robotvel( float * robotvel, float w, int i );
	void get_world( float * world );
	void robot_kick( int level, int i );
	void robot_dribble( int enable, int i );

};

#endif
